svyset wustlid [pweight= mar2012wt1], vce(linearized) singleunit(missing)

/***Creating Variables (already created in replication materials

/* Generate Treatment Group Dummy */
tab xrosas, gen (Treatment)

/* First Question */
svy: tab ROSAS1S29
svy: tab ROSAS11S29
svy: tab ROSAS21S29
svy: tab ROSAS31S29
svy: tab ROSAS41S29

/* Dummy for any credit or blame on retro */
gen credit1=.
replace credit1=1 if ROSAS1S29==1 |ROSAS1S29==2
replace credit1=0 if ROSAS1S29==3 |ROSAS1S29==4

gen blame2=.
replace blame2=1 if ROSAS11S29==1 |ROSAS11S29==2
replace blame2=0 if ROSAS11S29==3 |ROSAS11S29==4

gen credit3=.
replace credit3=1 if ROSAS21S29==1 |ROSAS21S29==2
replace credit3=0 if ROSAS21S29==3 |ROSAS21S29==4

gen blame4=.
replace blame4=1 if ROSAS31S29==1 |ROSAS31S29==2
replace blame4=0 if ROSAS31S29==3 |ROSAS31S29==4

gen creditblame5=.
replace creditblame5=1 if ROSAS41S29==1 |ROSAS41S29==2
replace creditblame5=0 if ROSAS41S29==3 |ROSAS41S29==4

gen creditblame=0 if credit1~=. | blame2~=. | credit3~=. | blame4~=. | creditblame5~=.
replace creditblame=1 if credit1==1 | blame2==1 | credit3==1 | blame4==1 | creditblame5==1

/* Generate variable for retrospective credit or blame for all 5 treatments */

gen retcreditblame=.
replace retcreditblame=credit1 if credit1~=.
replace retcreditblame=blame2 if blame2~=.
replace retcreditblame=credit3 if credit3~=.
replace retcreditblame=blame4 if blame4~=.
replace retcreditblame=creditblame5 if creditblame5~=.

/* Generating ordinal variable for ret credit or blame */
gen retcreditblameOrd=.
replace retcreditblameOrd=ROSAS1S29 if ROSAS1S29~=. 
replace retcreditblameOrd=ROSAS11S29 if ROSAS11S29~=. 
replace retcreditblameOrd=ROSAS21S29 if ROSAS21S29~=. 
replace retcreditblameOrd=ROSAS31S29 if ROSAS31S29~=. 
replace retcreditblameOrd=ROSAS41S29 if ROSAS41S29~=. 
replace retcreditblameOrd=. if retcreditblameOrd==-1

/* Dummy for great deal of credit or blame on retro */
gen credit1g=.
replace credit1g=1 if ROSAS1S29==1
replace credit1g=0 if ROSAS1S29==2 | ROSAS1S29==3 |ROSAS1S29==4

gen blame2g=.
replace blame2g=1 if ROSAS11S29==1 
replace blame2g=0 if ROSAS11S29==2 | ROSAS11S29==3 |ROSAS11S29==4

gen credit3g=.
replace credit3g=1 if ROSAS21S29==1 
replace credit3g=0 if ROSAS21S29==2 | ROSAS21S29==3 |ROSAS21S29==4

gen blame4g=.
replace blame4g=1 if ROSAS31S29==1 
replace blame4g=0 if ROSAS31S29==2 | ROSAS31S29==3 |ROSAS31S29==4

gen creditblame5g=.
replace creditblame5g=1 if ROSAS41S29==1 
replace creditblame5g=0 if ROSAS41S29==2 | ROSAS41S29==3 |ROSAS41S29==4

/* generate variable for credit or blame for great deal of credit or blame */
gen retcreditblameg=.
replace retcreditblameg=credit1g if credit1g~=.
replace retcreditblameg=blame2g if blame2g~=.
replace retcreditblameg=credit3g if credit3g~=.
replace retcreditblameg=blame4g if blame4g~=.
replace retcreditblameg=creditblame5g if creditblame5g~=.



/* Dummy for any credit or blame on prospective credit or blame */
gen procredit1=.
replace procredit1=1 if ROSAS3S29==1 |ROSAS3S29==2
replace procredit1=0 if ROSAS3S29==3 |ROSAS3S29==4

gen problame2=.
replace problame2=1 if ROSAS13S29==1 |ROSAS13S29==2
replace problame2=0 if ROSAS13S29==3 |ROSAS13S29==4

gen procredit3=.
replace procredit3=1 if ROSAS23S29==1 |ROSAS23S29==2
replace procredit3=0 if ROSAS23S29==3 |ROSAS23S29==4

gen problame4=.
replace problame4=1 if ROSAS33S29==1 |ROSAS33S29==2
replace problame4=0 if ROSAS33S29==3 |ROSAS33S29==4

/* Dummy for great deal of credit or blame on prospective credit or blame */
gen procredit1g=.
replace procredit1g=1 if ROSAS3S29==1 
replace procredit1g=0 if ROSAS3S29==2 |ROSAS3S29==3 |ROSAS3S29==4

gen problame2g=.
replace problame2g=1 if ROSAS13S29==1 
replace problame2g=0 if ROSAS13S29==2 | ROSAS13S29==3 |ROSAS13S29==4

gen procredit3g=.
replace procredit3g=1 if ROSAS23S29==1 
replace procredit3g=0 if ROSAS23S29==2 | ROSAS23S29==3 |ROSAS23S29==4

gen problame4g=.
replace problame4g=1 if ROSAS33S29==1 
replace problame4g=0 if ROSAS33S29==2 | ROSAS33S29==3 |ROSAS33S29==4

gen procreditblame5g=.
replace procreditblame5g=1 if ROSAS43S29==1 
replace procreditblame5g=0 if ROSAS43S29==2 | ROSAS43S29==3 |ROSAS43S29==4

gen procreditblameg=.
replace procreditblameg=procredit1g if procredit1g~=.
replace procreditblameg=problame2g if problame2g~=.
replace procreditblameg=procredit3g if procredit3g~=.
replace procreditblameg=problame4g if problame4g~=.
replace procreditblameg=procreditblame5g if procreditblame5g~=.

/* Prospective vote intentions */
gen vote1=ROSAS4S29 if ROSAS4S29~=-1
gen vote2=ROSAS14S29 if ROSAS14S29~=-1
gen vote3=ROSAS24S29 if ROSAS24S29~=-1
gen vote4=ROSAS34S29 if ROSAS34S29~=-1
gen vote5=ROSAS43S29 if ROSAS43S29~=-1

gen votepro=vote1 if vote1~=.
replace votepro=vote2 if vote2~=.
replace votepro=vote3 if vote3~=.
replace votepro=vote4 if vote4~=.
replace votepro=vote5 if vote5~=.

gen votepro2=0 if votepro~=.
replace votepro2=1 if votepro==1 | votepro==2

/* Generating Control Variables */
gen dem=0 if PARTYID1S27~=.
replace dem=1 if PARTYID1S27==1
gen rep=0 if PARTYID1S27~=.
replace rep=1 if PARTYID1S27==2
gen ind=0 if PARTYID1S27~=.
replace ind=1 if PARTYID1S27==3

gen globalization=0
replace globalization=1 if Treatment3==1 | Treatment4==1

/* Manipulation Checks */
gen correct=0 if ROSAS2S29~=. | ROSAS12S29~=. | ROSAS22S29~=. | ROSAS32S29~=. 
replace correct=1 if ROSAS2S29==1 | ROSAS12S29==2 | ROSAS22S29==1 | ROSAS32S29==2 

gen slowcorrect=0 if ROSAS12S29~=. | ROSAS32S29~=.
replace slowcorrect=1 if ROSAS12S29==2 | ROSAS32S29==2

gen fastcorrect=0 if ROSAS2S29~=. | ROSAS22S29~=.
replace fastcorrect=1 if ROSAS2S29==1 | ROSAS22S29==1
svy: tab slowcorrect
svy: tab fastcorrect

***/

/* Appendix C Analysis */
/* Panel 1 */
svy: tab retcreditblameg xrosas, col ci level(95)
/* Panel 2 */
svy: tab procreditblameg xrosas, col ci level(95)
/* Panel 3 */
svy: tab votepro2 xrosas, col ci level(95)


/* NEW CONFIDENCE INTERVAL AROUND PERCENTAGE GRAPHS */
svy: tab creditOutcome xgroupab, col ci level(95)

